<template>
  <div class="web_buy absolute">
    <div class="back">
      <img src="http://diandian.zgkpz.com/images/m_get/back.png" />
    </div>
    <div class="main">
      <div class="toubu">
        <div>
          <img src="http://diandian.zgkpz.com/images/class/quan.png" />
        </div>
        <div>
          <span>大宝DSD</span>
          <p>购买商品享受多重优惠</p>
        </div>
      </div>
      <div>
        <img src="http://diandian.zgkpz.com/images/class/gou.png" class="gou" />
      </div>

      <div class="swiper-container">
        <div class="swiper-wrapper">
          <div class="swiper-slide">
            <div class="content">
              <h2>听音识图全年课程</h2>
              <small>超值优惠</small>
              <p>
                ·小学，初中，高中6000单词量 ·15000个关卡
                ·45万个句型，上百万次重复 ·听说读写一网打尽，顺便考高分
              </p>
              <span>￥4680元</span>
            </div>
          </div>
          <div class="swiper-slide">
            <div class="content">
              <h2>听音识图全年课程</h2>
              <small>超值优惠</small>
              <p>
                ·小学，初中，高中6000单词量 ·15000个关卡
                ·45万个句型，上百万次重复 ·听说读写一网打尽，顺便考高分
              </p>
              <span>￥4680元</span>
            </div>
          </div>
          <div class="swiper-slide">
            <div class="content">
              <h2>听音识图全年课程</h2>
              <small>超值优惠</small>
              <p>
                ·小学，初中，高中6000单词量 ·15000个关卡
                ·45万个句型，上百万次重复 ·听说读写一网打尽，顺便考高分
              </p>
              <span>￥4680元</span>
            </div>
          </div>
          <div class="swiper-slide">
            <div class="content">
              <h2>听音识图全年课程</h2>
              <small>超值优惠</small>
              <p>
                ·小学，初中，高中6000单词量 ·15000个关卡
                ·45万个句型，上百万次重复 ·听说读写一网打尽，顺便考高分
              </p>
              <span>￥4680元</span>
            </div>
          </div>
        </div>
        <div class="swiper-pagination"></div>
      </div>
    </div>
  </div>
</template>
<script>
import Swiper from "swiper";
import "swiper/dist/css/swiper.min.css";
export default {
  name: "Buy",
  data: function () {
    return {};
  },
  methods: {
    handleResize() {
      if (document.body.clientWidth < 770) {
        this.$router.replace({ path: "/buy" });
      }
    },
  },
  created() {
    window.addEventListener("resize", this.handleResize);
  },
  mounted() {
    var swiper = new Swiper(".swiper-container", {
      slidesPerView: 4.5,
      spaceBetween: 30,
      centeredSlides: true,
      loop: true,
      pagination: {
        el: ".swiper-pagination",
        clickable: true,
      },
    });
  },
};
</script>

<style scoped>
.main {
  font-family: SimHei;
  text-align: center;
}
.gou {
  width: 0.33rem;
  position: relative;
  top: 2.974rem;
  z-index: 999;
  left: 0.522rem;
}
.toubu {
  width: 3rem;
  display: inline-flex;
  justify-content: space-around;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.2rem;
  text-align: left;
}
.toubu img {
  background: url("http://diandian.zgkpz.com/images/index/touxiang.png")
    no-repeat;
  background-size: 0.55rem;
  width: 0.65rem;
  background-position-x: 0.05rem;
  background-position-y: 0.05rem;
}
.toubu span {
  color: #ffffff;
  font-size: 0.2rem;
}
.toubu p {
  color: #3514ff;
  font-size: 0.2rem;
}
html,
body {
  position: relative;
  height: 100%;
}
body {
  background: #eee;
  font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #000;
  margin: 0;
  padding: 0;
}
.swiper-container {
  width: 100%;
  height: 100%;
  margin-top: 1.2rem;
}
.swiper-slide {
  text-align: center;
  font-size: 0.02rem;
  background: url("http://diandian.zgkpz.com/images/class/proback.png")
    no-repeat;
  background-size: 100% 100%;
  display: block;
  height: 1.8rem;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
  transition: 300ms;
  transform: scale(0.8);
}

.swiper-slide-active,
.swiper-slide-duplicate-active {
  transform: scale(1);
}
.content {
  width: 1.5rem;
  text-align: left;
  margin-left: 0.17rem;
}
.content h2 {
  margin-top: 0.14rem;
  color: #ffffff;
  font-size: 0.1rem;
}
.content small {
  margin-top: 0.09rem;
  color: #feff81;
  display: block;
  font-size: 0.08rem;
}
.content p {
  margin-top: 0.1rem;
  color: #0c1f66;
  font-size: 0.09rem;
  width: 1.1rem;
}
.content span {
  margin-top: 0.37rem;
  color: #feff81;
  display: block;
  font-size: 0.1rem;
}
.code img {
  width: 100%;
  height: 100%;
}
.back img {
  padding: 0.29rem;
  position: absolute;
  width: 0.9rem;
}
</style>
